<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMchOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mch_order', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('member_id')->unsigned()->comment('会员id');
            $table->char('order_id',15)->index()->comment('订单号id');
            $table->integer('money')->unsigned()->comment('订单金额');
            $table->char('source',10)->default('red')->comment('支付源(red=发红包,open=企业支付到零钱，开红包直接到账金额,open-award=企业支付到零钱，用户分享红包后的奖励,deposit=企业支付到零钱，用户提现)');
            $table->integer('source_id')->unsigned()->comment('支付源id');
            $table->tinyInteger('status')->unsigned()->default(1)->comment('订单状态（1=未支付，2=支付成功，6=未支付，支付失败，8=订单异常）');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mch_order');
    }
}
